package fr.umlv.m2.jee.birt.persistence.comment.dao;

import javax.persistence.Query;

import fr.umlv.m2.jee.birt.persistence.comment.Comment;
import fr.umlv.m2.jee.birt.persistence.comment.ICommentDAO;
import org.springframework.stereotype.Repository;

@Repository
public class DefaultCommentDAO extends GenericDAOImpl<Comment, Long > implements ICommentDAO {

    public Comment findByBusinessId(String businessId) {
        Query query = createQuery("select c from Comment as c where c.businessId=:businessId");
        query.setParameter("businessId", businessId);

        return (Comment)query.getSingleResult();
    }

}
